package com.ruoyi.framework.web.exception;


import com.ruoyi.framework.web.enums.AbnormalEnum;

/**
 * 通用全局异常
 *
 */
public class TadpoleException extends RuntimeException {

	private final int code;

	public TadpoleException() {
		this(1, "操作失败");
	}

	public TadpoleException(AbnormalEnum.MSG msg) {
		super(msg.getMessage());
		this.code = msg.getCode();
	}

	public TadpoleException(int code, String message) {
		super(message);
		this.code = code;
	}

	public TadpoleException(String message) {
		this(1, message);
	}

	public int getCode() {
		return code;
	}

}
